package cn.lisynet.api.service.impl;

import cn.hutool.core.util.IdUtil;
import cn.lisynet.api.entity.PdTask;
import cn.lisynet.api.mapper.PdTaskMapper;
import cn.lisynet.api.service.PdTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

/**
 * @author lisy
 */
@Service
public class PdTaskServiceImpl extends ServiceImpl<PdTaskMapper, PdTask> implements PdTaskService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public void addTask(String taskSn) {
        PdTask task = new PdTask();
        task.setTaskSn(taskSn);
        this.baseMapper.insert(task);
    }

    @Override
    public void addContent(String content) {
        String sql="insert into pd_content (content) values (?)";
        jdbcTemplate.update(sql, IdUtil.fastUUID());
    }
}
